package com.zqk.pattern.creational.simplefactory;

/**
 * @Package com.zpk.pattern.creational.simplefactory
 * @Description:TODO
 * @Author 张乾坤
 * @Create: 2018/10/25
 * @Version 1.0
 * @Update: message
 */
public class VideoFactory {

    /*public Video getVideo(String type){
        if("java".equalsIgnoreCase(type)){
            return new JavaVideo();
        }else if("python".equalsIgnoreCase(type)){
            return new PythonVideo();
        }
        return null;
    }*/

    public Video getVideo(Class c) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Video video=null;
        video=(Video)Class.forName(c.getName()).newInstance();
        return video;
    }
}
